namespace QMVnSoft.Opening
{
    using QMVnSoft;
    using QMVnSoft.Controls;
    using QMVnSoft.DAL;
    using System;
    using System.ComponentModel;
    using System.Drawing;

    public class FormCDZ3Lister : FormOpenningLister
    {
        private IContainer components;
        private CDZDataAccess oMethod = new CDZDataAccess();

        public FormCDZ3Lister()
        {
            this.oMethod = new CDZDataAccess();
            this.InitializeComponent();
            //OnRefresh();
        }

        public FormCDZ3Lister(bool pb_CheckDetailMost, object poUserDefined1, object poUserDefined2, object poUserDefined3) : base(pb_CheckDetailMost, poUserDefined1, poUserDefined2, poUserDefined3)
        {
            this.oMethod = new CDZDataAccess();
            this.InitializeComponent();
            //OnRefresh();
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.components != null))
            {
                this.components.Dispose();
            }
            base.Dispose(disposing);
        }

        private void InitializeComponent()
        {
            base.SuspendLayout();
            base.AutoScaleDimensions = new SizeF(6f, 13f);
            base.ClientSize = new Size(0x31a, 0x1cf);
            base.Name = "FormCDZ1Lister";
            this.Text = "Giá trị sản phẩm dở dang";
            base.ResumeLayout(false);
            base.PerformLayout();
        }

        protected override void OnGenerateColumns()
        {
            object[][] objArray = new object[3][];
            object[] objArray2 = new object[4];
            objArray2[0] = "Ma_Sp";
            objArray2[1] = "Mã sản phẩm";
            objArray2[2] = "C";
            objArray[0] = objArray2;
            object[] objArray3 = new object[4];
            objArray3[0] = "Ten_Sp";
            objArray3[1] = "Tên sản phẩm";
            objArray3[2] = "C";
            objArray[1] = objArray3;
            objArray[2] = new object[] { "Du_Cuoi", "Giá trị dở dang", "N", AppInstance.TextNumericFormat.LocalAmount };
            base.LocalColNames = objArray;
            base.OnGenerateColumns();
        }

        protected override void OnRefresh()
        {
            DateTime time = (DateTime) base.UserDefined1;
            base.LocalTable = this.oMethod.GetDataTable(AppInstance.Subsidiary, time.AddDays(-1.0), base.UserDefined3);
        }

        protected override void OnShowDetail()
        {
            base.LocalChildForm = new FormCDZ30Lister(true, base.UserDefined1, base.UserDefined2, base.UserDefined3);
            base.OnShowDetail();
        }
    }
}

